//
//  BA_JobManager.h
//  BaseProject
//
//  Created by 王洋 on 2021/4/21.
//  Copyright © 2021 王洋. All rights reserved.
//  用于管理跨页面间的任务

#import <Foundation/Foundation.h>
#import "JobModel.h"

NS_ASSUME_NONNULL_BEGIN

@interface BA_JobManager : NSObject

//manager
+ (BA_JobManager *)manager;

//添加job【单纯添加】
- (void)addJobWithModel:(JobModel *)model;

//去重添加   保证只有一个
- (void)addSingleJobWithModel:(JobModel *)model;

//更新job
- (void)updateJobWithModel:(JobModel *)model;

//检查是否触发
- (void)checkTriggerWithType:(BA_JobManagerType)type comption:(void (^)(BOOL success))comption;


//获取某类job
- (JobModel *)getJobWithType:(BA_JobManagerType)type;

//移除某一类job
- (void)removeJobWithType:(BA_JobManagerType)type;

//检查某个job要不要触发

//慎用，仅用于退出登录切换账号
- (void)clearAllJobs;

@end

NS_ASSUME_NONNULL_END
